<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8"/>
    <title>自定义菜单</title>
    <link rel="stylesheet" href="${base}/res/manage/css/common.css">
    <link rel="stylesheet" href="${base}/res/manage/css/ec.css">
    <link rel="stylesheet" href="${base}/res/manage/css/list.css">
</head>
<body>
<div class="tab set">
    <h3>[#--<a href="javascript:;">首页</a>--]<a href="javascript:;">微信管理</a><a href="list.jhtml">> 自定义菜单管理</a></h3>
    <form id="listForm" action="list.jhtml" method="get">
        <div class="txte">
            <p class="txtl" >
                <a href="add.jhtml" class="ared"> + 添加菜单</a>
                <a href="javascript:;" class="ared" id="generateMenu">同步菜单</a>
            </p>
        </div>
        <div class="tablist">
            <table cellpadding="0" cellspacing="0" class="scrollTable">
                <tr>
                    <th>菜单名称</th>
                    <th>操作类型</th>
                    <th>消息类型</th>
                    <th>是否可用</th>
                    <th>修改时间</th>
                    <th class="icon">操作</th>
                </tr>
            [#list list as wxMenu]
                <tr>
                    <td class="center" [#if wxMenu.parentId??]style="padding-left:40px;"[/#if]>
                        ${wxMenu.name}
                    </td>
                    <td class="center">
                    ${stdCodeName("WXMENU_TYPE",wxMenu.type)}
                    </td>
                    <td class="center">
                    ${stdCodeName("WXMENU_MSGTYPE",wxMenu.msgType)}
                    </td>
                    <td class="center">
                    ${stdCodeName("IS_ENABLED",wxMenu.isEnabled?string("1","0"))}
                    </td>
                    <td class="center">
                        ${wxMenu.modifyDate?string("yyyy-MM-dd HH:mm")}
                    </td>
                    <td class="icon">
                        <div>
                            <a href="edit.jhtml?id=${wxMenu.id}" class="edit" title="编辑"></a>
                            <a href="javascript:;" type="delOne" idName="id" idVal="${wxMenu.id}" class="delete" title="删除"></a>
                        </div>
                    </td>
                </tr>
            [/#list]
            </table>
        </div>
    </form>
</div>
</body>
<script type="text/javascript" src="${base}/res/plugin/jquery/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="${base}/res/plugin/validator/jquery.validate.min.js"></script>
<script type="text/javascript" src="${base}/res/plugin/layer/layer.min.js"></script>
<script type="text/javascript" src="${base}/res/admin/js/common.js"></script>
<script type="text/javascript" src="${base}/res/admin/js/list.js"></script>
<script type="text/javascript" src="${base}/res/admin/js/scrollView.js"></script>
<script type="text/javascript" src="${base}/res/admin/js/initWidth.js"></script>
<script type="text/javascript">

    $(function () {
    [@flash_message /]

        $("#generateMenu").click(function(){
            $.get("generateMenu.jhtml",null,function(data){
                if (data) {
                    $.message(data.type, data.content);
                }
            });
        });

    });

</script>
</html>